package com.yyfax.pay.third.facade.minsheng;

import com.yyfax.pay.third.model.to.minsheng.CheckBatchPayoutOrderMinshengContent;
import com.yyfax.pay.third.model.to.minsheng.CheckBatchPayoutOrderMinshengParams;
import com.yyfax.pay.third.model.to.minsheng.PayoutOrderMinshengContent;
import com.yyfax.pay.third.model.to.minsheng.PayoutOrderMinshengParams;
import com.yyfax.pay.third.model.to.minsheng.QueryBatchPayoutOrderMinshengContent;
import com.yyfax.pay.third.model.to.minsheng.QueryBatchPayoutOrderMinshengParams;
import com.yyfax.pay.third.model.to.yyfax.AuthenticationYYContent;
import com.yyfax.pay.third.model.to.yyfax.AuthenticationYYParams;
import com.yyfax.pay.third.model.to.yyfax.QueryBatchPayoutOrderCheckYYContent;
import com.yyfax.pay.third.model.to.yyfax.QueryBatchPayoutOrderCheckYYParams;
import com.yyfax.pay.third.model.to.yyfax.PayoutBatchOrderYYContent;
import com.yyfax.pay.third.model.to.yyfax.PayoutBatchOrderYYParams;
import com.yyfax.pay.third.model.to.yyfax.OrderNotifyContent;
import com.yyfax.pay.third.model.to.yyfax.OrderReturnContent;
import com.yyfax.pay.third.model.to.yyfax.PayOrderYYContent;
import com.yyfax.pay.third.model.to.yyfax.PayOrderYYParams;
import com.yyfax.pay.third.model.to.yyfax.PayoutOrderYYContent;
import com.yyfax.pay.third.model.to.yyfax.PayoutOrderYYParams;
import com.yyfax.pay.third.model.to.yyfax.QueryBatchPayoutOrderYYContent;
import com.yyfax.pay.third.model.to.yyfax.QueryBatchPayoutOrderYYParams;
import com.yyfax.pay.third.model.to.yyfax.QueryCardBinContent;
import com.yyfax.pay.third.model.to.yyfax.QueryCardBinParams;
import com.yyfax.pay.third.model.to.yyfax.QueryPayOrderYYContent;
import com.yyfax.pay.third.model.to.yyfax.QueryPayOrderYYParams;
import com.yyfax.pay.third.model.to.yyfax.QueryPayoutOrderYYContent;
import com.yyfax.pay.third.model.to.yyfax.QueryPayoutOrderYYParams;
import com.yyfax.pay.third.model.to.yyfax.SendAuthenticationVerifyCodeYYContent;
import com.yyfax.pay.third.model.to.yyfax.SendAuthenticationVerifyCodeYYParams;
import com.yyfax.pay.third.model.to.yyfax.SendVerifyCodeYYContent;
import com.yyfax.pay.third.model.to.yyfax.SendVerifyCodeYYParams;
import com.yyfax.pay.third.model.to.yyfax.WebFormYYContent;
import com.yyfax.pay.third.model.to.yyfax.WebFormYYParams;
import com.yyfax.pay.third.service.ThirdPayService;
import com.yyfax.pay.third.service.TransformService;

import org.apache.commons.lang.NotImplementedException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * 民生代付接口外观
 * @author AlanQiu on 2017/4/18.
 */
public class MinshengFacade extends ThirdPayService {

	private Logger logger = LoggerFactory.getLogger(getClass());

	@Resource(name = "minshengTransformService")
	private TransformService transformService;

	@Autowired
	private MinshengApi minshengApi;
	
	@PostConstruct
	private void init() {
		this.facadeName = "民生";
	}
	
	@Override
	public QueryPayOrderYYContent queryOrder(QueryPayOrderYYParams req) throws Exception {
		throw new NotImplementedException("民生代付不支持");
	}

	@Override
	public SendAuthenticationVerifyCodeYYContent sendAuthenticationVerifyCode(SendAuthenticationVerifyCodeYYParams req) throws Exception {
		throw new NotImplementedException("民生代付不支持");
	}

	@Override
	public AuthenticationYYContent authentication(AuthenticationYYParams req) throws Exception {
		throw new NotImplementedException("民生代付不支持");
	}

	@Override
	public SendVerifyCodeYYContent sendVerifyCode(SendVerifyCodeYYParams req) throws Exception {
		throw new NotImplementedException("民生代付不支持");
	}

	@Override
	public PayOrderYYContent payOrder(PayOrderYYParams req) throws Exception {
		throw new NotImplementedException("民生代付不支持");
	}

	@Override
	public PayoutOrderYYContent payoutOrder(PayoutOrderYYParams req) throws Exception {
		throw new NotImplementedException("民生代付不做单笔代付");
	}

	@Override
	public PayoutBatchOrderYYContent payoutBatchOrder(PayoutBatchOrderYYParams req) throws Exception {
		PayoutOrderMinshengParams payoutOrderMinshengParams = transformService.transformBatchPayoutOrderParams(req);
		PayoutOrderMinshengContent payoutOrderMinshengContent = minshengApi.payout(payoutOrderMinshengParams);
		PayoutBatchOrderYYContent payoutBatchOrderYYContent = transformService.transformBatchPayoutOrderContent(payoutOrderMinshengContent);
		return payoutBatchOrderYYContent;
	}

	@Override
	public QueryBatchPayoutOrderYYContent queryBatchPayoutOrder(QueryBatchPayoutOrderYYParams req) throws Exception {
		QueryBatchPayoutOrderMinshengParams queryBatchPayoutOrderMinshengParams = transformService.transformQueryBatchPayoutOrderParams(req);
		QueryBatchPayoutOrderMinshengContent queryBatchPayoutOrderMinshengContent = minshengApi.queryPayout(queryBatchPayoutOrderMinshengParams);
		QueryBatchPayoutOrderYYContent queryBatchPayoutOrderYYContent = transformService.transformQueryBatchPayoutOrderContent(queryBatchPayoutOrderMinshengContent);
		return queryBatchPayoutOrderYYContent;
	}

	@Override
	public QueryBatchPayoutOrderCheckYYContent batchPayoutOrderCheck(QueryBatchPayoutOrderCheckYYParams req) throws Exception {
		CheckBatchPayoutOrderMinshengParams checkBatchPayoutOrderMinshengParams = transformService.transformBatchPayoutOrderCheckParams(req);
		CheckBatchPayoutOrderMinshengContent checkBatchPayoutOrderMinshengContent = minshengApi.checkPayout(checkBatchPayoutOrderMinshengParams);
		QueryBatchPayoutOrderCheckYYContent batchPayoutOrderCheckYYContent = transformService.transformBatchPayoutOrderCheckContent(checkBatchPayoutOrderMinshengContent);
		return batchPayoutOrderCheckYYContent;
	}

	@Override
	public QueryCardBinContent queryCardBin(QueryCardBinParams req) throws Exception {
		throw new NotImplementedException("民生代付不支持");
	}

	@Override
	public WebFormYYContent<?> transformWebForm(WebFormYYParams req) throws Exception {
		throw new NotImplementedException("民生代付不支持");
	}

	@Override
	public OrderReturnContent transformPayOrderReturn(HttpServletRequest request) throws Exception {
		throw new NotImplementedException("民生代付不支持");
	}

	@Override
	public OrderNotifyContent transformPayOrderNotify(HttpServletRequest request) throws Exception {
		throw new NotImplementedException("民生代付不支持");
	}

	@Override
	public OrderNotifyContent transformPayoutOrderNotify(HttpServletRequest request) throws Exception {
		throw new NotImplementedException("民生代付不支持");
	}

	@Override
	public QueryPayoutOrderYYContent queryPayoutOrder(QueryPayoutOrderYYParams req) throws Exception {
		throw new NotImplementedException("富友支付不支持");
	}
}
